package myJs.user.soft

import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.all._
import myJs.api.Api
import myJs.tool.Tool.messages
import shared.Pojo.SoftT

/** Created by yz on 3/11/2020
  */
object VideoCp {

  case class Props(soft: SoftT) {
    @inline def render: VdomElement = {
      Component(this)
    }
  }

  val Component = ScalaFnComponent[Props] { props =>
    val soft = props.soft

    object FTool {}

    div(
      className := "top top-tools-header",
      display.flex,
      justifyContent.spaceBetween,
      div(
        className := "title clear",
        a(href := s"${Api.soft.toIndex}", messages("softCenter")),
        " / ",
        span(messages(soft.nameStr))
      ),
      div(
        className := "col-right-tool",
        a(
          href := s"${Api.soft.video(s"${soft.videoFileName}.mp4")}",
          target.blank,
          className := "btn",
          display.flex,
          alignItems.center,
          i(className := "fa fa-file-video-o", paddingRight := 3.px),
          s" ${messages("tutorialVideo")}"
        )
      )
    )
  }

}
